package com.ypd.shop.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ypd.shop.mapper.StatisticMapper;
import com.ypd.shop.domain.Statistic;
import com.ypd.shop.service.IStatisticService;

/**
 * 文章点击量Service业务层处理
 * 
 * @author lin
 * @date 2025-01-16
 */
@Service
public class StatisticServiceImpl implements IStatisticService 
{
    @Autowired
    private StatisticMapper statisticMapper;



    /**
     * 查询文章点击量列表
     * 
     * @param statistic 文章点击量
     * @return 文章点击量
     */
    @Override
    public List<Statistic> selectStatisticList(Statistic statistic)
    {
        return statisticMapper.selectStatisticList(statistic);
    }

    /**
     * 新增文章点击量
     * 
     * @param statistic 文章点击量
     * @return 结果
     */
    @Override
    public int insertStatistic(Statistic statistic)
    {
        return statisticMapper.insertStatistic(statistic);
    }

    /**
     * 修改文章点击量
     * 
     * @param statistic 文章点击量
     * @return 结果
     */
    @Override
    public int updateStatistic(Statistic statistic)
    {
        return statisticMapper.updateStatistic(statistic);
    }

    /**
     * 批量删除文章点击量
     * 
     * @param ids 需要删除的文章点击量主键
     * @return 结果
     */
    @Override
    public int deleteStatisticByIds(Long[] ids)
    {
        return statisticMapper.deleteStatisticByIds(ids);
    }

    /**
     * 删除文章点击量信息
     * 
     * @param id 文章点击量主键
     * @return 结果
     */
    @Override
    public int deleteStatisticById(Long id)
    {
        return statisticMapper.deleteStatisticById(id);
    }

    /**
     * 根据文章id查询对应的点击量
     * @param propertyId
     * @return
     */
    public Statistic selectStatisticByPropertyId(Long propertyId){
        return statisticMapper.selectStatisticByPropertyId(propertyId);
    }
}
